package com.example.validated.vo;

import com.example.validated.annotation.VerifySeq;
import lombok.Data;

import javax.validation.constraints.*;

@Data
public class VerifySeqDTO {
    @NotNull(message = "ID不能为空", groups = VerifySeq.N5.class)
    private Integer id;

    @NotBlank(message = "姓名不能为空", groups = VerifySeq.N3.class)
    private String name;

    @NotBlank
    @Pattern(regexp = "[a-zA-Z0-9]", message = "只允许输入数字和字母", groups = VerifySeq.N4.class)
    private String strValue;

    @Min(value = 0, message = "值不能小于0", groups = VerifySeq.N2.class)
    @Max(value = 100, message = "值不能超过100", groups = VerifySeq.N6.class)
    private Integer age;

    @NotEmpty(message = "地址不能为空", groups = VerifySeq.N1.class)
    private String addr;
}
